﻿Imports System.Data.SqlClient

Public Class ViewUser
    Inherits System.Web.UI.Page
    Private Shared prevPage As String = String.Empty

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not IsPostBack) Then
            prevPage = Request.UrlReferrer.ToString()
        End If

        'SQL to load employee
        Dim con As New SqlConnection
        Dim cmd As New SqlCommand

        'change this to get our Oracle
        con.ConnectionString = "Data Source=localhost;Initial Catalog=invsystem;Persist Security  Info=True;User ID=s12setwin;Password=JDLOAF"

        'open a connection to the db
        con.Open()

        'send command to the database
        cmd.Connection = con

        'set the SQL as the command
        cmd.CommandText = "SELECT * FROM EMPLOYEE WHERE id="

        'read the info returned from the sql
        Dim lrd As SqlDataReader = cmd.ExecuteReader()
        While lrd.Read()
        End While

    End Sub

    Protected Sub homeButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles homeButton.Click
        Response.Redirect("/User_View/AdminView/AdminHome.aspx")
    End Sub

    Protected Sub backButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles backButton.Click
        Response.Redirect(prevPage)
    End Sub

    Protected Sub employeeManagementButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles employeeManagementButton.Click
        Response.Redirect("/Employee_Management/ManageEmployee.aspx")
    End Sub

    Protected Sub workshopManagementButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles workshopManagementButton.Click
        Response.Redirect("/Workshop_Management/WorkshopA/ManageWorkshops.aspx")
    End Sub
End Class